<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2024/9/23
  Time: 20:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录</title>
    <style>
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }

        table {
            border-collapse: collapse;
            border: 1px solid black;
        }

        th, td {
            border: 1px solid black;
            padding: 8px;
        }
    </style>
</head>
<body>
<table>
    <tr>
        <td>
            <h2>登录</h2>
            <%
                String error = request.getParameter("error");
                if (error!= null) {
            %>
            <p style="color: red;"><%=error%></p>
            <%
                }
            %>
            <form action="login" method="post">
                <label for="username">用户名:</label>
                <input type="text" id="username" name="username">
                <br>
                <label for="password">密  码:</label>
                <input type="password" id="password" name="password">
                <br>
                <%
                    String redirectUrl = request.getParameter("redirectUrl");
                    if (redirectUrl!= null) {
                %>
                <input type="hidden" name="redirectUrl" value="<%=redirectUrl%>">
                <%
                    }
                %>
                <input type="submit" value="登录">
            </form>
        </td>
    </tr>
</table>
</body>
</html>